﻿// MT430




using Little.Soldier.SWIFT;
using Little.Soldier.SWIFT.Definition;
using System.Collections.Generic;
using System.ComponentModel;

namespace Little.Soldier.SWIFT.Messages.Category4
{
  public class MT430 : SwiftMessage
  {
    private static SwiftMessageDefinition MessageDefinition;
    private static SwiftTagSequenceDefinition U0002;
    private static SwiftTagDefinition U0003;
    private static SwiftTagSubItemDefinition U0004;
    private static SwiftTagDefinition U0005;
    private static SwiftTagSubItemDefinition U0006;
    private static SwiftTagChoiceDefinition U0007;
    private static SwiftTagDefinition U0008;
    private static SwiftTagSubItemDefinition U000E;
    private static SwiftTagSubItemDefinition U000F;
    private static SwiftTagSubItemDefinition U0010;
    private static SwiftTagDefinition U0011;
    private static SwiftTagSubItemDefinition U0012;
    private static SwiftTagSubItemDefinition U0013;
    private static SwiftTagSubItemDefinition U0014;
    private static SwiftTagSubItemDefinition U0015;
    private static SwiftTagSubItemDefinition U0016;
    private static SwiftTagChoiceDefinition U0017;
    private static SwiftTagDefinition U0018;
    private static SwiftTagSubItemDefinition U0019;
    private static SwiftTagSubItemDefinition U001A;
    private static SwiftTagSubItemDefinition U001B;
    private static SwiftTagDefinition U001C;
    private static SwiftTagSubItemDefinition U001D;
    private static SwiftTagSubItemDefinition U001E;
    private static SwiftTagSubItemDefinition U001F;
    private static SwiftTagSubItemDefinition U007F;
    private static SwiftTagSubItemDefinition U0080;
    private static SwiftTagSequenceDefinition U0081;
    private static SwiftTagDefinition U0082;
    private static SwiftTagSubItemDefinition U0083;
    private static SwiftTagSubItemDefinition U0084;
    private static SwiftTagSubItemDefinition U0086;
    private static SwiftTagDefinition U0087;
    private static SwiftTagDefinition U0088;

    [Description("SequenceA")]
    public MT430.SequenceAClass[] SequenceA
    {
      get
      {
        int index = -1;
        List<MT430.SequenceAClass> list = new List<MT430.SequenceAClass>();
        int count;
        do
        {
          ++index;
          MT430.SequenceAClass sequenceAclass = new MT430.SequenceAClass((SwiftElement) this, index, false);
          count = this.ListTags((SwiftElement) sequenceAclass).Count;
          if (count > 0)
            list.Add(sequenceAclass);
        }
        while (count > 0);
        return list.ToArray();
      }
    }

    [Description("SequenceB")]
    public MT430.SequenceBClass SequenceB
    {
      get
      {
        MT430.SequenceBClass sequenceBclass = new MT430.SequenceBClass((SwiftElement) this, 0, false);
        if (this.ListTags((SwiftElement) sequenceBclass).Count > 0)
          return sequenceBclass;
        else
          return (MT430.SequenceBClass) null;
      }
    }

    public MT430()
      : base(true)
    {
    }

    public MT430(SwiftMessage message)
      : base(message)
    {
    }

    public MT430.SequenceAClass AddSequenceA()
    {
      return new MT430.SequenceAClass((SwiftElement) this, this.SequenceA.Length, true);
    }

    public void RemoveSequenceA(MT430.SequenceAClass sequence)
    {
      foreach (SwiftTag tag in this.ListTags((SwiftElement) sequence))
        this.RemoveTag(tag);
    }

    public MT430.SequenceBClass AddSequenceB()
    {
      return this.SequenceB ?? new MT430.SequenceBClass((SwiftElement) this, 0, true);
    }

    public void RemoveSequenceB(MT430.SequenceBClass sequence)
    {
      foreach (SwiftTag tag in this.ListTags((SwiftElement) sequence))
        this.RemoveTag(tag);
    }

    internal override SwiftMessageDefinition MsgDefinition()
    {
      return MT430.MessageDefinition;
    }

    protected override void InitSwiftMessageDefinition()
    {
      MT430.MessageDefinition = new SwiftMessageDefinition("MT430", "Amendment of Instructions");
      MT430.U0002 = new SwiftTagSequenceDefinition("SequenceA", "SequenceA");
      MT430.U0002.Multiple = true;
      MT430.U0003 = new SwiftTagDefinition("SendingBanksTRN_A_20", "Sending Bank’s TRN");
      MT430.U0003.TagName = ":20:";
      MT430.U0004 = new SwiftTagSubItemDefinition("Reference", "Reference");
      MT430.U0003.Elements.Add((SwiftDefinitionElement) MT430.U0004);
      MT430.U0002.Elements.Add((SwiftDefinitionElement) MT430.U0003);
      MT430.U0005 = new SwiftTagDefinition("RelatedReference_A_21", "Related Reference");
      MT430.U0005.TagName = ":21:";
      MT430.U0006 = new SwiftTagSubItemDefinition("Reference", "Reference");
      MT430.U0005.Elements.Add((SwiftDefinitionElement) MT430.U0006);
      MT430.U0002.Elements.Add((SwiftDefinitionElement) MT430.U0005);
      MT430.U0007 = new SwiftTagChoiceDefinition("Choice", "");
      MT430.U0007.Mandatory = false;
      MT430.U0007.Multiple = true;
      MT430.U0008 = new SwiftTagDefinition("ExistingMaturityDateCurrencyCodeAmount_A_32A", "Existing Maturity Date, Currency Code, Amount");
      MT430.U0008.TagName = ":32A:";
      MT430.U000E = new SwiftTagSubItemDefinition("Date", "Date");
      MT430.U0008.Elements.Add((SwiftDefinitionElement) MT430.U000E);
      MT430.U000F = new SwiftTagSubItemDefinition("Currency", "Currency");
      MT430.U0008.Elements.Add((SwiftDefinitionElement) MT430.U000F);
      MT430.U0010 = new SwiftTagSubItemDefinition("Amount", "Amount");
      MT430.U0008.Elements.Add((SwiftDefinitionElement) MT430.U0010);
      MT430.U0007.Elements.Add((SwiftDefinitionElement) MT430.U0008);
      MT430.U0011 = new SwiftTagDefinition("ExistingMaturityDateCurrencyCodeAmount_A_32K", "Existing Maturity Date, Currency Code, Amounturity Date, Currency Code, Amount");
      MT430.U0011.TagName = ":32K:";
      MT430.U0012 = new SwiftTagSubItemDefinition("DayMonth", "Day/Month");
      MT430.U0011.Elements.Add((SwiftDefinitionElement) MT430.U0012);
      MT430.U0013 = new SwiftTagSubItemDefinition("NumberOfDaysMonths", "Number Of Days Months");
      MT430.U0011.Elements.Add((SwiftDefinitionElement) MT430.U0013);
      MT430.U0014 = new SwiftTagSubItemDefinition("Code", "Code");
      MT430.U0011.Elements.Add((SwiftDefinitionElement) MT430.U0014);
      MT430.U0015 = new SwiftTagSubItemDefinition("Currency", "Currency");
      MT430.U0011.Elements.Add((SwiftDefinitionElement) MT430.U0015);
      MT430.U0016 = new SwiftTagSubItemDefinition("Amount", "Amount");
      MT430.U0011.Elements.Add((SwiftDefinitionElement) MT430.U0016);
      MT430.U0007.Elements.Add((SwiftDefinitionElement) MT430.U0011);
      MT430.U0002.Elements.Add((SwiftDefinitionElement) MT430.U0007);
      MT430.U0017 = new SwiftTagChoiceDefinition("Choice", "");
      MT430.U0017.Mandatory = false;
      MT430.U0017.Multiple = true;
      MT430.U0018 = new SwiftTagDefinition("AmendedMaturityDateCurrencyCodeAmount_A_33A", "Amended Maturity Date Currency Code Amount");
      MT430.U0018.TagName = ":33A:";
      MT430.U0019 = new SwiftTagSubItemDefinition("Date", "Date");
      MT430.U0018.Elements.Add((SwiftDefinitionElement) MT430.U0019);
      MT430.U001A = new SwiftTagSubItemDefinition("Currency", "Currency");
      MT430.U0018.Elements.Add((SwiftDefinitionElement) MT430.U001A);
      MT430.U001B = new SwiftTagSubItemDefinition("Amount", "Amount");
      MT430.U0018.Elements.Add((SwiftDefinitionElement) MT430.U001B);
      MT430.U0017.Elements.Add((SwiftDefinitionElement) MT430.U0018);
      MT430.U001C = new SwiftTagDefinition("AmendedMaturityDateCurrencyCodeAmount_A_33K", "Amended Maturity Date Currency Code Amount");
      MT430.U001C.TagName = ":33K:";
      MT430.U001D = new SwiftTagSubItemDefinition("DayMonth", "Day/Month");
      MT430.U001C.Elements.Add((SwiftDefinitionElement) MT430.U001D);
      MT430.U001E = new SwiftTagSubItemDefinition("NumberOfDaysMonths", "Number Of Days Months");
      MT430.U001C.Elements.Add((SwiftDefinitionElement) MT430.U001E);
      MT430.U001F = new SwiftTagSubItemDefinition("Code", "Code");
      MT430.U001C.Elements.Add((SwiftDefinitionElement) MT430.U001F);
      MT430.U007F = new SwiftTagSubItemDefinition("Currency", "Currency");
      MT430.U001C.Elements.Add((SwiftDefinitionElement) MT430.U007F);
      MT430.U0080 = new SwiftTagSubItemDefinition("Amount", "Amount");
      MT430.U001C.Elements.Add((SwiftDefinitionElement) MT430.U0080);
      MT430.U0017.Elements.Add((SwiftDefinitionElement) MT430.U001C);
      MT430.U0002.Elements.Add((SwiftDefinitionElement) MT430.U0017);
      MT430.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT430.U0002);
      MT430.U0081 = new SwiftTagSequenceDefinition("SequenceB", "SequenceB");
      MT430.U0081.Mandatory = false;
      MT430.U0082 = new SwiftTagDefinition("Drawee_B_59", "Drawee");
      MT430.U0082.TagName = ":59:";
      MT430.U0082.Mandatory = false;
      MT430.U0083 = new SwiftTagSubItemDefinition("Account", "Account");
      MT430.U0083.Mandatory = false;
      MT430.U0084 = new SwiftTagSubItemDefinition("Account_1", "Account");
      MT430.U0083.Elements.Add((SwiftDefinitionElement) MT430.U0084);
      MT430.U0082.Elements.Add((SwiftDefinitionElement) MT430.U0083);
      MT430.U0086 = new SwiftTagSubItemDefinition("NameAndAddress", "Name And Address");
      MT430.U0082.Elements.Add((SwiftDefinitionElement) MT430.U0086);
      MT430.U0081.Elements.Add((SwiftDefinitionElement) MT430.U0082);
      MT430.U0087 = new SwiftTagDefinition("SenderToReceiverInformation_B_72", "Sender To Receiver Information");
      MT430.U0087.TagName = ":72:";
      MT430.U0087.Mandatory = false;
      MT430.U0081.Elements.Add((SwiftDefinitionElement) MT430.U0087);
      MT430.U0088 = new SwiftTagDefinition("Amendments_B_74", "Amendments");
      MT430.U0088.TagName = ":74:";
      MT430.U0088.Mandatory = false;
      MT430.U0081.Elements.Add((SwiftDefinitionElement) MT430.U0088);
      MT430.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT430.U0081);
    }

    public class SequenceAClass : SwiftTagSequence
    {
      internal override SwiftDefinitionElement Definition
      {
        get
        {
          return (SwiftDefinitionElement) MT430.U0002;
        }
      }

      [Description("Sending Bank’s TRN")]
      public Tag20 SendingBanksTRN_A_20
      {
        get
        {
          return new Tag20((SwiftElement) this, 0, (SwiftDefinitionElement) MT430.U0003);
        }
      }

      [Description("Sending Bank’s TRN")]
      public Tag20 Tag20_SendingBanksTRN_A
      {
        get
        {
          return this.SendingBanksTRN_A_20;
        }
      }

      [Description("Related Reference")]
      public Tag21 RelatedReference_A_21
      {
        get
        {
          return new Tag21((SwiftElement) this, 0, (SwiftDefinitionElement) MT430.U0005);
        }
      }

      [Description("Related Reference")]
      public Tag21 Tag21_RelatedReference_A
      {
        get
        {
          return this.RelatedReference_A_21;
        }
      }

      [Description("Existing Maturity Date, Currency Code, Amount")]
      public Tag32A ExistingMaturityDateCurrencyCodeAmount_A_32A
      {
        get
        {
          return new Tag32A((SwiftElement) this, 0, (SwiftDefinitionElement) MT430.U0008);
        }
      }

      [Description("Existing Maturity Date, Currency Code, Amount")]
      public Tag32A Tag32A_ExistingMaturityDateCurrencyCodeAmount_A
      {
        get
        {
          return this.ExistingMaturityDateCurrencyCodeAmount_A_32A;
        }
      }

      [Description("Existing Maturity Date, Currency Code, Amounturity Date, Currency Code, Amount")]
      public Tag32K ExistingMaturityDateCurrencyCodeAmount_A_32K
      {
        get
        {
          return new Tag32K((SwiftElement) this, 0, (SwiftDefinitionElement) MT430.U0011);
        }
      }

      [Description("Existing Maturity Date, Currency Code, Amounturity Date, Currency Code, Amount")]
      public Tag32K Tag32K_ExistingMaturityDateCurrencyCodeAmount_A
      {
        get
        {
          return this.ExistingMaturityDateCurrencyCodeAmount_A_32K;
        }
      }

      [Description("Amended Maturity Date Currency Code Amount")]
      public Tag33A AmendedMaturityDateCurrencyCodeAmount_A_33A
      {
        get
        {
          return new Tag33A((SwiftElement) this, 0, (SwiftDefinitionElement) MT430.U0018);
        }
      }

      [Description("Amended Maturity Date Currency Code Amount")]
      public Tag33A Tag33A_AmendedMaturityDateCurrencyCodeAmount_A
      {
        get
        {
          return this.AmendedMaturityDateCurrencyCodeAmount_A_33A;
        }
      }

      [Description("Amended Maturity Date Currency Code Amount")]
      public Tag33K AmendedMaturityDateCurrencyCodeAmount_A_33K
      {
        get
        {
          return new Tag33K((SwiftElement) this, 0, (SwiftDefinitionElement) MT430.U001C);
        }
      }

      [Description("Amended Maturity Date Currency Code Amount")]
      public Tag33K Tag33K_AmendedMaturityDateCurrencyCodeAmount_A
      {
        get
        {
          return this.AmendedMaturityDateCurrencyCodeAmount_A_33K;
        }
      }

      internal SequenceAClass(SwiftElement parent, int index, bool createTags)
        : base(parent, index, createTags)
      {
      }
    }

    public class SequenceBClass : SwiftTagSequence
    {
      internal override SwiftDefinitionElement Definition
      {
        get
        {
          return (SwiftDefinitionElement) MT430.U0081;
        }
      }

      [Description("Drawee")]
      public Tag59 Drawee_B_59
      {
        get
        {
          return new Tag59((SwiftElement) this, 0, (SwiftDefinitionElement) MT430.U0082);
        }
      }

      [Description("Drawee")]
      public Tag59 Tag59_Drawee_B
      {
        get
        {
          return this.Drawee_B_59;
        }
      }

      [Description("Sender To Receiver Information")]
      public Tag72 SenderToReceiverInformation_B_72
      {
        get
        {
          return new Tag72((SwiftElement) this, 0, (SwiftDefinitionElement) MT430.U0087);
        }
      }

      [Description("Sender To Receiver Information")]
      public Tag72 Tag72_SenderToReceiverInformation_B
      {
        get
        {
          return this.SenderToReceiverInformation_B_72;
        }
      }

      [Description("Amendments")]
      public Tag74 Amendments_B_74
      {
        get
        {
          return new Tag74((SwiftElement) this, 0, (SwiftDefinitionElement) MT430.U0088);
        }
      }

      [Description("Amendments")]
      public Tag74 Tag74_Amendments_B
      {
        get
        {
          return this.Amendments_B_74;
        }
      }

      internal SequenceBClass(SwiftElement parent, int index, bool createTags)
        : base(parent, index, createTags)
      {
      }
    }
  }
}
